package com.crt.uav.api.v1;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;

@RestController
@RequestMapping("/api/v1")
@Tag(name = "Test API", description = "Test API for checking the server status")
public class TestEndpoint {


    @GetMapping("/test")
    @Operation(summary = "Test endpoint", description = "A simple test endpoint to check if the server is running")
    public ResponseEntity<String> test() {
        return ResponseEntity.ok("Test endpoint is working!");
    }

    @GetMapping("/test2")
    @Operation(summary = "Test2 endpoint", description = "A simple test2 endpoint to check if the server is running")
    public ResponseEntity<String> test2(@Parameter(name = "param", description = "参数", required = true) @RequestParam String param) {
        return ResponseEntity.ok("Test2 endpoint is working!");
    }

    @GetMapping("/test3")
    public ResponseEntity<String> test3() {
        return ResponseEntity.ok("Test3 endpoint is working!");
    }

}
